package com.huawei.gamebox.service.common.cardkit.card;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.LayoutParams;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.service.common.cardkit.bean.LeavesSideslipCardBean;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard.a;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard.a.b;
import o.chc;
import o.exp$a;
import o.exp.j;

public class LeavesSideslipCard extends HorizonBaseCard {

    class d extends a {
        final /* synthetic */ LeavesSideslipCard ˋ;

        class d extends b {
            private LeavesFlatpCard ॱˋ;
            final /* synthetic */ d ᐝॱ;

            d(d dVar, View view) {
                this.ᐝॱ = dVar;
                super(dVar, view);
                this.ॱˋ = new LeavesFlatpCard(view.getContext());
                this.ॱˋ.ˊ(dVar.ˋ.ˊ.ॱ() + (dVar.ˋ.ˊ.ॱॱ() * (dVar.ˋ.ˏ + 2)));
                this.ॱˋ.ˋ(dVar.ˋ.ˏ);
                this.ॱˋ.ˏ(view);
                this.ॱˋ.ˉ().setClickable(true);
                this.ʻॱ = view;
                this.ॱˋ.ॱ(dVar.ˋ.ˋ());
            }
        }

        private d(LeavesSideslipCard leavesSideslipCard) {
            this.ˋ = leavesSideslipCard;
            super(leavesSideslipCard);
        }

        public b ॱ(ViewGroup viewGroup, int i) {
            View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(j.ᐧ, viewGroup, false);
            LayoutParams layoutParams = (LayoutParams) inflate.getLayoutParams();
            if (layoutParams != null) {
                layoutParams.topMargin = viewGroup.getContext().getResources().getDimensionPixelSize(exp$a.ʽॱ);
            }
            return new d(this, inflate);
        }

        protected void ˋ(b bVar, int i) {
            LeavesSideslipCardBean leavesSideslipCardBean = (LeavesSideslipCardBean) this.ˋ.ˊᐝ;
            if (bVar instanceof d) {
                ((CardBean) leavesSideslipCardBean.ᐝ().get(i)).ˋˋ(leavesSideslipCardBean.ॱˉ());
                ((d) bVar).ॱˋ.ˏ((CardBean) leavesSideslipCardBean.ᐝ().get(i));
            }
        }

        public int ˏ() {
            CardBean ˌ = this.ˋ.ˌ();
            if (ˌ instanceof LeavesSideslipCardBean) {
                LeavesSideslipCardBean leavesSideslipCardBean = (LeavesSideslipCardBean) ˌ;
                if (leavesSideslipCardBean.ᐝ() != null) {
                    return leavesSideslipCardBean.ᐝ().size();
                }
            }
            return 0;
        }
    }

    public LeavesSideslipCard(Context context) {
        super(context);
    }

    protected void ʻ() {
        this.ˏ = chc.ʻ();
    }

    protected RecyclerView.a ˊॱ() {
        return new d();
    }
}
